let api_config = {
	list: {
		url: "",
		action: 'kucun_getDetailList',
		method: "get",
	},
	add: {
		url: "",
		action: "",
		method: "get"
	},
	edit: {
		url: "",
		action: "",
		method: "get",
		id_field: "id",
		is_query_detail: true
	},
	delete: {
		url: "",
		action: "",
		method: "get",
		id_field: "id",
	},
	detail: {
		url: "",
		action: "",
		method: "get",
		id_field: "id",
	},
}


let column_params = {
	"id": "",
	"formId": "",
	"inventoryId": "",
	"productId": "",
	"pdtInfo": "",
	"storeId": "",
	"storeName": "",
	"orderId": "",
	"num": "",
	"kucun": "",
	"remark": "",
	"status": "",
	"type": "",
	"typeDesc": "",
	"units": "",
	"shenheTime": "",
	"price": "",
	"chengben": "",
	"zongchengben": "",
	"zhesun": "",
	"createdTime": ""
}


let columns = [{
		"sort_in_form": "",
		"field": "id",
		"field_title": "ID",
		"table_width": "auto",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	},
	// {
	// 	"sort_in_form": "",
	// 	"field": "formId",
	// 	"field_title": "",
	// 	"table_width": "auto",
	// 	"table_render_type": "text",
	// 	"form_render_type": "input",
	// 	"is_hidden_in_table": false,
	// 	"is_hidden_in_form": false,
	// 	"is_required_in_form": false
	// }, 
	{
		"sort_in_form": "",
		"field": "inventoryId",
		"field_title": "规格ID",
		"table_width": "auto",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	},
	{
		"sort_in_form": "",
		"field": "productId",
		"field_title": "产品ID",
		"table_width": "auto",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	},
	{
		"sort_in_form": "",
		"field": "cus_pdtInfo_image",
		"field_title": "图片",
		"table_width": "auto",
		"table_render_type": "image",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	},
	{
		"sort_in_form": "",
		"field": "cus_pdtInfo_title",
		"field_title": "标题",
		"table_width": "auto",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	},

	{
		"sort_in_form": "",
		"field": "cus_pdtInfo_keyVals",
		"field_title": "规格",
		"table_width": "auto",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	},
	{
		"sort_in_form": "",
		"field": "cus_pdtInfo_sn",
		"field_title": "编号",
		"table_width": "auto",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	},
	// {
	// 	"sort_in_form": "",
	// 	"field": "storeId",
	// 	"field_title": "仓库ID",
	// 	"table_width": "auto",
	// 	"table_render_type": "text",
	// 	"form_render_type": "input",
	// 	"is_hidden_in_table": false,
	// 	"is_hidden_in_form": false,
	// 	"is_required_in_form": false
	// }, 
	// {
	// 	"sort_in_form": "",
	// 	"field": "storeName",
	// 	"field_title": "仓库名",
	// 	"table_width": "auto",
	// 	"table_render_type": "text",
	// 	"form_render_type": "input",
	// 	"is_hidden_in_table": false,
	// 	"is_hidden_in_form": false,
	// 	"is_required_in_form": false
	// }, 
	// {
	// 	"sort_in_form": "",
	// 	"field": "orderId",
	// 	"field_title": "订单ID",
	// 	"table_width": "auto",
	// 	"table_render_type": "text",
	// 	"form_render_type": "input",
	// 	"is_hidden_in_table": false,
	// 	"is_hidden_in_form": false,
	// 	"is_required_in_form": false
	// }, 
	
	{
		"sort_in_form": "",
		"field": "num",
		"field_title": "数量",
		"table_width": "auto",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	}, {
		"sort_in_form": "",
		"field": "kucun",
		"field_title": "库存",
		"table_width": "auto",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	}, {
		"sort_in_form": "",
		"field": "units",
		"field_title": "单位",
		"table_width": "auto",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	},{
		"sort_in_form": "",
		"field": "remark",
		"field_title": "备注",
		"table_width": "300",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	}, {
		"sort_in_form": "",
		"field": "status",
		"field_title": "状态",
		"table_width": "auto",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	}, {
		"sort_in_form": "",
		"field": "type",
		"field_title": "类型",
		"table_width": "auto",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	}, 
	{
		"sort_in_form": "",
		"field": "typeDesc",
		"field_title": "类型细分",
		"table_width": "auto",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	},  
	// {
	// 	"sort_in_form": "",
	// 	"field": "shenheTime",
	// 	"field_title": "审核时间",
	// 	"table_width": "auto",
	// 	"table_render_type": "text",
	// 	"form_render_type": "input",
	// 	"is_hidden_in_table": false,
	// 	"is_hidden_in_form": false,
	// 	"is_required_in_form": false
	// }, 
	// {
	// 	"sort_in_form": "",
	// 	"field": "price",
	// 	"field_title": "价格",
	// 	"table_width": "auto",
	// 	"table_render_type": "text",
	// 	"form_render_type": "input",
	// 	"is_hidden_in_table": false,
	// 	"is_hidden_in_form": false,
	// 	"is_required_in_form": false
	// }, 
	// {
	// 	"sort_in_form": "",
	// 	"field": "chengben",
	// 	"field_title": "成本",
	// 	"table_width": "auto",
	// 	"table_render_type": "text",
	// 	"form_render_type": "input",
	// 	"is_hidden_in_table": false,
	// 	"is_hidden_in_form": false,
	// 	"is_required_in_form": false
	// }, 
	// {
	// 	"sort_in_form": "",
	// 	"field": "zongchengben",
	// 	"field_title": "总成本",
	// 	"table_width": "auto",
	// 	"table_render_type": "text",
	// 	"form_render_type": "input",
	// 	"is_hidden_in_table": false,
	// 	"is_hidden_in_form": false,
	// 	"is_required_in_form": false
	// }, 
	// {
	// 	"sort_in_form": "",
	// 	"field": "zhesun",
	// 	"field_title": "折损",
	// 	"table_width": "auto",
	// 	"table_render_type": "text",
	// 	"form_render_type": "input",
	// 	"is_hidden_in_table": false,
	// 	"is_hidden_in_form": false,
	// 	"is_required_in_form": false
	// }, 
	{
		"sort_in_form": "",
		"field": "createdTime",
		"field_title": "时间",
		"table_width": "150",
		"table_render_type": "text",
		"form_render_type": "input",
		"is_hidden_in_table": false,
		"is_hidden_in_form": false,
		"is_required_in_form": false
	}
]

let table_columns = columns.filter(v => !v.is_hidden_in_table).map(v => ({
	...v
}))
// [
//     // {
//     //     column: "postId",//字段属性名
//     //     field_title: "ID", //字段标题
//     //     table_width: "auto",//表格宽度
//     //     column_sortable: false, //表格是否可排序
//     //     column_show_overflow_tooltip: false, //表格悬浮是否展示提示
//     //     table_render_type: '',//表格展示类型   '' || text || tag || image || image-list || file
//     // },
// ]

let form_fields = columns.filter(v => !v.is_hidden_in_form).map(v => ({
	...v
}))

// 表单默认值
let form_fields_default_value = {
	// "id": "",
	// "title": "",
	// "parentId": 0,
	// "ordering": 0,
	// "thumb": "",
	// "description": ""
}

// [
//     //【form_render_type 类型列表】
//     //input 默认
//     //number 文字输入
//     //textarea 文本域
//     //date 日期
//     //select 下拉选
//     //radio 单选
//     //cascader 级联选择
//     //upload-image 上传图片
//     //upload-file 上传文件
//     //rich-editor 富文本编辑器
//     //topic-card 话题卡片
//     {
//         column: "postId",
//         field_title: "ID",
//         is_required: 1,
//         form_render_type: "ID", //'' || text || tag || image || image-list || file
//         //选项型数据
//         // labelKey: "channelName",
//         // valueKey: "channelId",
//         // options: newsTypeOptions,

//         // 文件上传
//         // upload_multiple: true,
//         // upload_limit: 9,
//         // upload_tip: "(可上传多图，建议图片压缩后上传)",
//         // cache_key: "upload_cover_list", //图片上传回显
//         // saveFormat: "jsonObjectArray",
//     },
// ]


// console.log('字段配置 columns', JSON.parse(JSON.stringify(columns)))
console.log('表格配置 table_columns', JSON.parse(JSON.stringify(table_columns)))
console.log('表单配置 form_fields', JSON.parse(JSON.stringify(form_fields)))

// console.log('字段配置 columns', (JSON.stringify(columns)))
// console.log('表格配置 table_columns', (JSON.stringify(table_columns)))
// console.log('表单配置 form_fields', (JSON.stringify(form_fields)))




let table_row_actions = [
	// {
	// 	title: '编辑',
	// },
	// {
	// 	title: '删除',
	// },

]



let radio_options_map = {
	status: [{
			title: '发布',
			value: 1,
			type: '',
		},
		{
			title: '草稿',
			value: 0,
			type: 'info',
		},
	],
	position: [{
			title: '通用',
			value: 1,
			type: '',
		},
		{
			title: 'PC',
			value: 2,
			type: '',
		}, {
			title: 'H5',
			value: 3,
			type: '',
		}, {
			title: '小程序',
			value: 4,
			type: '',
		}, {
			title: 'APP',
			value: 5,
			type: '',
		},
	],
}

// 上传配置
let upload_config_map = {
	'thumb': {
		multiple: false,
		limit: 1,
		tip: '请选择文件',
	},
	'images': {
		multiple: true,
		limit: 100,
		tip: '请选择文件',
	},
	'videoImg': {
		multiple: false,
		limit: 1,
		tip: '请选择文件',
	},
}


let table_column_tag_map = {
	status: {
		0: {
			title: '正常',
			type: '',
		},
		1: {
			title: '停用',
			type: 'info',
		},
	}
}


let tree_config_map = {
	
}


export default {
	api_config,
	table_columns,
	table_column_tag_map,
	form_fields,
	form_fields_default_value,
	table_row_actions,
	radio_options_map,
	upload_config_map,
	tree_config_map,
};